$(document).ready(function (){
	// body...
	$(".menu_ul p").click(function(){
		$(this).parent("li").addClass('ulOpen ');	
		$(this).parent("li").siblings("li").removeClass('ulOpen');	
		$('.ulOpen ul').slideDown();
		$('.ulOpen p span').removeClass('glyphicons-chevron-right').addClass('glyphicons-chevron-down');  
        $('.ulOpen').siblings('li').children("ul").slideUp();
        $('.ulOpen').siblings('li').children("p").children("span").removeClass('glyphicons-chevron-down').addClass('glyphicons-chevron-right');
	})
	
  //消息弹窗
    $(".dataForm").Validform({ 
        tiptype:function(msg){        //提交数据显示
            layer.alert(msg,{icon:0});
        },
        tipSweep:true,
        ajaxPost:true,  
        callback:function(o){              //根据返回的状态码提示语句
            if (o.status == 200) {
                layer.msg(o.message,{
                    icon:6,
                    skin:'layer_mobile_login',
                    time:1200
                });
                setTimeout(function () {  
                    self.location=o.return_url;      
                },1500);
            }else if (o.status == 300) {
                layer.msg(o.message,{
                    icon:6,
                    skin:'layer_mobile_login',
                    time:1200
                });
                setTimeout(function () {  
                    history.go(0) ;      
                },1500);    
            }else {
                layer.msg(o.message,{
                    icon:5,
                    skin:'layer_mobile_login',
                    time:1200
                });    
            }    
        }
    });
    //编辑器代码
    KindEditor.ready(function(K) {
        K.create('#content', {                     //编辑器属性代码
            allowFileManager : true,
            afterBlur : function() {                  //防止编辑器失焦
            this.sync();
            }
        });
        var editor = K.editor({                       //图片上传组件
            allowFileManager : true
        });
        K('#image3').click(function() {
            editor.loadPlugin('image', function() {
                editor.plugin.imageDialog({
                    showRemote : false,
                    imageUrl : K('#url3').val(),
                    clickFn : function(url, title, width, height, border, align) {
                      K('#url3').val(url);
                      editor.hideDialog();
                    }
                });
            });
        });
    });
});